<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
	<style type="text/css">
			#row{
			margin:20px;
			font-size: 16px;
			}
		</style>
<script type="text/javascript">
 function doEdit(){
	var sellerId="${object.sellerId}";
	var power=$("#power").val();
		Kit.confirm("提示","确定修改公司权限吗？",function(ref){
			$.post("${BASE_PATH}/dict/seller/tong/edit",{sellerId:sellerId,power:power},function(result){
				if(result.flag==0){
					Kit.alert("操作成功");
					onEditSuccess(result.object);
					editDialog.close();
				}else{
					Kit.alert("操作失败");return;
				}
				
			});
		});
 	}
   $(document).ready(function() {
     $(".radioItem").change(function() {
         var $selectedvalue = $("input[name='state']:checked").val();
         if ($selectedvalue == 1) {
        	 $("input[name=power]").val(1);
         }else if($selectedvalue == 2){
        	 $("input[name=power]").val(2);
         }
     });
 });  
</script>
 <div >
 	<div class="row" id="rows" style="text-align: center;">
	    <label style="font-size:20px;">公司权限修改</label>
	</div>
	<div class="row" id="rows">
	    <label class="text-label" >公司名称：</label>
	    <div class="text-content" >${object.sellerName}</div>
	 </div>
	<div class="row" id="rows">
	    <label class="text-label">权限状态：</label>
	    <input hidden="hidden" type="text" id="power" name="power" value="${object.power}"/>
	 	<div class="text-content">开启 :&nbsp;&nbsp;<input type="radio" class="radioItem" id="state1" name="state" value="1" <c:if test="${object.power == 1 }">checked="checked"</c:if>/>
	 	&nbsp;&nbsp;关闭 :&nbsp;&nbsp;<input type="radio" class="radioItem" id="state2" name="state" value="2" <c:if test="${object.power == 2 }">checked="checked"</c:if>/></div>
	</div>
	<div class="row" id="rows">
		<div class="col-lg-6"><button class="btn btn-primary col-sm-3 pull-right" type="submit" onclick="doEdit();">提交</button></div>
		<div class="col-lg-6"><button class="btn btn-default col-sm-3 pull-left"  type="button" onclick="javascript:editDialog.close();" autocomplete="off">取消</button></div>
	</div>
</div>